﻿@namespace SimpleBoard.Backend.Pages
@page "/employee"
<div>
        <PageContainer Title="员工管理">
        <Breadcrumb>
            <Breadcrumb>
                <BreadcrumbItem>主页</BreadcrumbItem>
                <BreadcrumbItem>员工管理</BreadcrumbItem>
            </Breadcrumb>
        </Breadcrumb>
        <ChildContent>
            <div class="standardList">
                <Card Class="listCard"
                      Title="员工列表"
                      Style="margin-top: 24px;"
                      BodyStyle="padding: 0 32px 40px 32px">
                    <ChildContent>
                        <Button Type="dashed"
                                Style="width: 100%; margin-bottom: 8px;"
                                OnClick="ShowModal">
                            <Icon Type="plus" Theme="outline" />
                            添加员工
                        </Button>

                        <AntList TItem="Employee"
                                 DataSource="_data"
                                 ItemLayout="ListItemLayout.Horizontal">
                            <ListItem Actions="_actions">
                                <ListItemMeta Description="@context.EmployeeId.ToString()">
                                    <TitleTemplate>
                                        <a>@context.Name</a>
                                    </TitleTemplate>
                                </ListItemMeta>
                                <div class="listContent">
                                    <div class="listContentItem">
                                        <span>手机号</span>
                                        <p>@context.Contact</p>
                                    </div>
                                    <div class="listContentItem">
                                        <span>邮箱</span>
                                        <p>@context.Email</p>
                                    </div>
                                </div>
                            </ListItem>
                        </AntList>
                    </ChildContent>
                </Card>
            </div>
        </ChildContent>
    </PageContainer>
</div>

@code {
    private static readonly RenderFragment Edit = @<a key="edit">Edit</a>;

    private readonly RenderFragment[] _actions = { Edit };
}
